/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import com.sun.lwuit.TextArea;
import com.sun.lwuit.layouts.BoxLayout;
import view.commands.BackCommand;
import view.commands.EmptyCommand;

/**
 *
 * @author Kvest
 */
public class MessageBox extends BasicForm
{
    private TextArea text;
       
    private int tag;
    
    public MessageBox()
    {
        super();
        
        tag = -1;
        
        init();
    }
    
    public void setText(String title, String text)
    {
        setTitle(title);
        this.text.setText(text);
    }
    
    private void init()
    {
        setLayout(new BoxLayout(BoxLayout.Y_AXIS));
        setCyclicFocus(false);
        
        text = new TextArea("", 1, 30);
        text.setEditable(false);
        text.setGrowByContent(true); 
        addComponent(text);

        addCommand(new EmptyCommand());
        addCommand(new BackCommand());
    }

    public int getTag() 
    {
        return tag;
    }

    public void setTag(int tag) 
    {
        this.tag = tag;
    }
}
